<?php


namespace App\Job;


use App\Config\QueueConfig;
use App\Http\Library\Queue;
use App\Http\Model\Job\BankEntryDataVerifyModel;

class BankEntryDataVerifyJob
{

    /**
     * 银行信息-银行入账数据核对
     *
     * @param array $data
     */
    public static function main(array $data)
    {
        /*当日收/退款款总额*/
        $fundTotal = BankEntryDataVerifyModel::fundTotal($data);
        /*更新记录*/
        BankEntryDataVerifyModel::save($data, $fundTotal);
    }


    /**
     * 银行信息-银行入账数据核对
     *
     * @param $createDate
     *
     * @throws \Exception
     */
    public static function call($createDate = '')
    {
        /*查询需要计算的监管账户*/
        $list = BankEntryDataVerifyModel::listPsfDw();
        foreach ($list as $val) {
            Queue::rpush([
                /*招行&数仓-业务线分校配置信息主键ID*/
                'pfs_dw_id'           => $val->id,
                /*机构编号，由招行分配*/
                'pfs_agencyid'        => $val->pfs_agencyid,
                /*监管账户-对应的主体数仓ID*/
                'ledger_subject_id'   => $val->ledger_subject_id,
                /*监管账户-对应的主体名称*/
                'ledger_subject_name' => $val->ledger_subject_name,
                /*监管账户-城市名称*/
                'city_name'           => $val->city_name,
                /*汇总日期*/
                'create_date'         => empty($createDate) ? date('Y-m-d') : $createDate,
            ], QueueConfig::BANK_ENTRYDATA_VERIFY);
        }
    }

}





/**
 * BankEntryDataVerifyJob.php
 *
 * 说明:
 *
 * 修改历史
 * ----------------------------------------
 * 2021/6/11 18:34:00   操作:创建
 **/
